import Vue from "vue";
import Router from 'vue-router'
// import Home from '../components/Home'

Vue.use(Router)

export default new Router({
    routes:[
        {
            path:'/',
            redirect:'/users/login',
            hidden:true,
            component:()=>import('@/components/Login')
        },
        {
            path:'/users/login',
            name:'Login',
            hidden:true,
            meta: {
                isEsnRequired: true
            },
            component:()=>import('@/components/Login')
        },
        {
            path:'/register',
            name:'register',
            hidden:true,
            component:()=>import('@/components/Register')
        },
        {
            path:'/home',
            name:'动物管理',
            iconClass:'fa fa-users',
            redirect:'/home/info',
            component:()=>import('@/components/Home'),
            children:[
                {
                    path:'/home/adopter',
                    name:'领养列表',
                    iconClass:'fa fa-list',
                    component:()=>import('@/components/students/AdopterList')
                },
                {
                    path:'/home/info',
                    name:'动物信息',
                    iconClass:'fa fa-list-alt',
                    component:()=>import('@/components/students/InfoList')
                },

            ]
        },
        {
            path:'/home',
            name:'数据分析',
            iconClass:'fa fa-bar-chart',
            redirect:'/home/info',
            component:()=>import('@/components/Home'),
            children:[
                {
                    path:'/home/dataview',
                    name:'数据概览',
                    iconClass:'fa fa-line-chart',
                    component:()=>import('@/components/dataAnalysis/DataView')
                },
                {
                    path:'/home/mapview',
                    name:'地图概览',
                    iconClass:'fa fa-line-chart',
                    component:()=>import('@/components/dataAnalysis/MapView')
                },
                {
                    path:'/home/travel',
                    name:'动态地图',
                    iconClass:'fa fa-line-chart',
                    component:()=>import('@/components/dataAnalysis/TravelMap')
                },
            ]
        },
        {
            path:'/users',
            name:'用户中心',
            iconClass:'fa fa-users',
            component:()=>import('@/components/Home'),
            children:[
                {
                    path:'/users/user',
                    name:'权限管理',
                    iconClass:'fa fa-user',
                    component:()=>import('@/components/users/User')
                },
                
            ]
        },
        {
            path:'*',
            name:'notFound',
            hidden:true,
            component:()=>import('@/components/NotFound')
        }
    ],
    mode:'history'
})